#include <stdio.h>

/*交换函数*/
void swap(int* a,int* b)
{
    int temp;
    temp=*a;
    *a=*b;
    *b=temp;
}

void main()
{
    int a=1;
    int b=2;
    printf("before: a=%d b=%d\n",a,b);
    swap(&a,&b);
    printf("after: a=%d b=%d\n",a,b);

}